﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using AlexandriaPressUserBusinessLayer;

namespace AlexandriaPressWebsite.MasterPages.UserPages
{
    public partial class SearchAllTitles : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Session.Add("userID", 1);
            UserBusinsessLayer business = new UserBusinsessLayer();
            DataTable table = business.searchTitleView(business.getAllTitles());
            allTitlesGridView1.DataSource = table;
            allTitlesGridView1.DataBind();
        }

        protected void allTitlesGridView1_OnPageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            UserBusinsessLayer business = new UserBusinsessLayer();
            allTitlesGridView1.PageIndex = e.NewPageIndex;
            allTitlesGridView1.DataSource = business.searchTitleView(business.getAllTitles());
            allTitlesGridView1.DataBind();
        }
    }
}
